<template>
    <div class="swiper">
      <div class="swiper-wrapper"> 
          <div class="swiper-slide" @click="goDailySongs"> 
              <p class="iconfont icon-rili" style="font-size: 0.47rem;"></p>
              <span>每日推荐</span>
          </div> 
          <div class="swiper-slide"> 
            <p class="iconfont icon-diantai"></p>
            <span>私人FM</span>
          </div> 
          <div class="swiper-slide"> 
            <p class="iconfont icon-gedan"></p>
            <span>歌单</span>
          </div> 
          <div class="swiper-slide"> 
            <p class="iconfont icon-PCbofangye_paihangbang"></p>
            <span>排行榜</span>
          </div> 
          <div class="swiper-slide"> 
            <p class="iconfont icon-zhuanjiguangpan"></p>
            <span>数字专辑</span>
          </div> 
          <div class="swiper-slide"> 
            <p class="iconfont icon-zhuanjiguangpan"></p>
            <span>数字专辑2</span>
          </div> 
          <div class="swiper-slide"> 
            <p class="iconfont icon-zhuanjiguangpan"></p>
            <span>数字专辑3</span>
          </div> 
      </div>
  </div>
  <div class="line"></div>
</template>

<script>
import Swiper from 'swiper'; 
import "swiper/dist/css/swiper.css";
import {onMounted} from 'vue'
import {useRouter} from 'vue-router'

export default {
  components: {
    Swiper
  },
  setup(){
     onMounted(()=>{
        var mySwiper2 = new Swiper('.swiper',{
          slidesPerView: 5,//数量
          // spaceBetween: 30,//间距
          slidesPerGroup: 1,//分几组
          direction : 'horizontal',//设置水平还是垂直vertical
        })
     })
     const router=useRouter();
     const goDailySongs=()=>{
         router.push({
           path:'/dailySongs'
         })
     }
     return{
       goDailySongs
     }
  }
};
</script>

<style>
.swiper{
  width: 7rem;
  height: 1.4rem;
  margin: 0.2rem 0.28rem 0rem 0.15rem;
  display: flex;
  justify-content: space-between;
}
.swiper-slide{
  width: 1.2rem;
  display: flex;
  align-items: center;
  flex-direction: column;
  text-align: center;
  color: rgba(0, 0, 0, 0.8);;
}
.swiper-slide p{
  background-color: rgba(0, 0, 0, 0.2);
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 1rem;
  border: 0px;
  font-size: 0.5rem;
  margin-bottom: 0.08rem;
  padding-top: 0.12rem;
}
.line{
  width: 7.5rem;
  height: 0.01rem;
  background-color: rgba(0, 0, 0, 0.2);
}
</style>
